﻿using System;
using System.Collections.Generic;

// Token: 0x020003DE RID: 990
public abstract class FactoryBase<T_Key, T_Product> where T_Product : FactoryProduct
{
	// Token: 0x060018B9 RID: 6329 RVA: 0x000A1498 File Offset: 0x0009F698
	public void Register(T_Key key, T_Product product)
	{
		this.dictionary.Add(key, product);
	}

	// Token: 0x060018BA RID: 6330 RVA: 0x000A14A8 File Offset: 0x0009F6A8
	public virtual object Create(T_Key key)
	{
		T_Product t_Product;
		if (this.dictionary.TryGetValue(key, out t_Product))
		{
			return t_Product.Clone();
		}
		return null;
	}

	// Token: 0x04001C2C RID: 7212
	protected Dictionary<T_Key, T_Product> dictionary = new Dictionary<T_Key, T_Product>();
}
